Ext.define('HGMIDE.view.IDEPluginManageSpace', {
	extend: 'Ext.Panel',
	xtype: 'idePluginManageSpace',
	config: {
		id: 'ide_plugin_manage_space',
		width: SysCfg.downLeftWidth,
		height: '100%',
		layout: {
			type: 'vbox'
		},
		listeners: {
			hide: function () {
				var ideEmulatorWorkSpace = Ext
					.getCmp('ide_emulator_work_space');
				var ideMmtVersionShow = Ext
					.getCmp('ide_mmt_version_show');
				var logger = Ext.getCmp('ide_logger');
				if (!logger.getHidden()) {
					var w = 100 - parseInt(logger.getWidth());
					ideEmulatorWorkSpace.setWidth(w + '%');
					ideMmtVersionShow.setWidth(w + '%');
					ideEmulatorWorkSpace.setStyle('margin-left:' +
						logger.getWidth());
				} else {
					ideEmulatorWorkSpace.setWidth('100%');
					ideEmulatorWorkSpace.setStyle('margin-left:0px');
				}
			},
			show: function () {
				var ideEmulatorWorkSpace = Ext
					.getCmp('ide_emulator_work_space');
				var ideMmtVersionShow = Ext
					.getCmp('ide_mmt_version_show');
				var idePluginManageSpace = Ext
					.getCmp('ide_plugin_manage_space');
				var logger = Ext.getCmp('ide_logger');
				if (!logger.getHidden()) {
					var w = 100 - parseInt(logger.getWidth());
					ideEmulatorWorkSpace.setWidth(w + '%');
					ideMmtVersionShow.setWidth(w + '%');
					var leftMargin = parseInt(logger.getWidth()) -
						parseInt(idePluginManageSpace.getWidth());
					ideEmulatorWorkSpace.setStyle('margin-left:' +
						leftMargin + '%');
				} else {
					ideEmulatorWorkSpace.setStyle('margin-left:0px');
					ideEmulatorWorkSpace
						.setWidth((100 - parseInt(SysCfg.downLeftWidth)) +
							'%');
				}
			}
		},
		items: [{
			id: 'ide_plugin_list',
			xtype: 'idePluginList',
			width: '100%',
			flex: 10
		}, {
			id: 'qrcodeLabel',
			flex: 1,
			maxHeight: '45px',
			xtype: 'titlebar',
			cls: 'qrcodeLabel',
			title: I18N.connectMM,
			items: [{
				id: 'qrcodeBtn',
				align: 'right',
				cls: 'qrcodeBtn',
				listeners: {
					tap: function () {
						if (this.getCls() == 'qrcodeBtn') {
							Ext.getCmp('qrcodePanel')
								.hide();
						} else {
							Ext.getCmp('qrcodePanel')
								.show();
						}

					}
				}
			}]
		}, {
			id: 'qrcodePanel',
			flex: 1,
			minHeight: '200px',
			xtype: 'panel',
			width: '100%',
			items: [{
				id: 'connectCode',
				xtype: 'label',
				html: 'QWERRTTYY',
				cls: 'connect_code'
			}, {
				id: 'qrcodeImage',
				xtype: 'image',
				width: '150px',
				height: '150px',
				// src : 'http://' + window.location.host
				// 		+ '/'+SysCfg.projectName+'/QRCodeGenerator'
			}],
			listeners: {
				hide: function () {
					var btn = Ext.getCmp('qrcodeBtn');
					btn.setCls('qrcodeBtn1');
				},
				show: function () {
					var btn = Ext.getCmp('qrcodeBtn');
					btn.setCls('qrcodeBtn');
				}
			}
		}]
	}
});